import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Member from '../views/Member.vue'
import ShopCar from '../views/ShopCar.vue'
import Search from '../views/Search.vue'
import Contact from '../views/Contact.vue'
import NewsList from '../views/news/List.vue'
import GoodsList from '../views/goods/List.vue'
import GoodsDetail from '../views/goods/GoodsDetail.vue'
import Detail from '../views/goods/Detail.vue'
import PhotoList from '../views/photo/List.vue'
import PhotoInfo from '../views/photo/Info.vue'
import GoodsAdd from '../views/goods/Add.vue'
import NewsDetail from '../views/news/Detail.vue'
import Comment from '../components/Comment.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/home' },
  { path: '/home', component: Home },
  { path: '/member', component: Member },
  { path: '/shopcar', component: ShopCar },
  { path: '/search', component: Search },
  { path: '/contact', component: Contact },
  { path: '/news/list', component: NewsList, },
  { path: '/news/detail/:id', component: NewsDetail },
  { path: '/photo/list',component: PhotoList, },
  { path: '/photo/info/:id',component: PhotoInfo, },
  { path: '/goods/list', component: GoodsList, },
  { path: '/goods/add', component: GoodsAdd, },

  { path: '/goods/detail/:id', component: GoodsDetail, },
  { path: '/goodsdesc/:id', component: Detail, },
  { path: '/comment/:id', component: Comment, },
]

const router = new VueRouter({
  routes
})

export default router